<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // function Star(name, ega) {

        //     this.name = name
        //     this.ega = ega
        //     this.pp = function () {
        //         console.log('haha ');
        //     }
        // }

        // Star.prototype = {
        //     constructor: Star,
        //     sh() {
        //         console.log(1);
        //     },
        //     hg() {
        //         console.log(2);
        //     }
        // }
        // var geg = new Star('哥哥', 18)
        // // Star.sex = '男'
        // // console.log(Star.sex);
        // geg.sh()
        // console.log(geg.__proto__.sh);
        // console.log(Star.prototype.constructor);



        var arr = [1, 2, 3, 4, 5, 6]
        var arr1 = [2, 3, 6, 8, 9, 8, 65, 1]
        Array.prototype.sun = function () {
            var sun = 0
            for (var i = 0; i < this.length; i++) {
                sun += this[i]
            }
            return sun
        }
        var arr = arr.sun()
        var arr1 = arr1.sun()
        console.log(arr);
        console.log(arr1);

        function fn(x,y){
            console.log(this);
            console.log(x*y*3);
        }
        var o = {
            name:'o'
        }
        fn.call(o, 1, 2)
    </script>
</body>

</html>